/**
 *autho xf
 * */
//$('#phones').keyup(function(event){
//    if(!(event.keyCode > 47 && event.keyCode < 57
//        || event.keyCode > 95 && event.keyCode < 106) ){
//        $(this).val('');
//    };
//});
    function KeyDownLogin(event) {
    if (event.keyCode == 13) {
        var phones = $("#phones").val();
        var pwd = $("#pwd").val();
        var token = $("#token").val();
        var remember = $("input[type='checkbox']").is(':checked');
        var ph = $("#ph");
        var phw = $("#phw");
        $(".ipt input").click(function () {
            $(".ipt span").html("");
        })
        if (phones == '' || phones == null) {
            ph.html("请输入正确手机号码");
            return false;
        }
        if (!(/^1(3|4|5|7|8)\d{9}$/.test(phones))) {
            ph.html("请输入正确的手机号码");
            return false;
        }
        if (pwd.length < 6 || pwd.length > 16) {
            phw.html("请输入6-16位的登录密码");
            return false;
        }
        $.ajax({
            url: '/qt_logsub',
            type: "post",
            data: {phones: phones, pwd: pwd, token: token, remember: remember},
            dataType: "json",
            timeout: 30000,
            success: function (json) {
                if (json.code == 1) {//ok
                    window.location.href = window.location.href;
                }
                if (json.code == 2) {//ok
                    phw.html(json.mess);
                }
                if (json.code == 3) {//ok
                    phw.html(json.mess);
                }
            }
        });
    }
    }

function  SubmitLogin(){
    var phones = $("#phones").val();
    var pwd = $("#pwd").val();
    var token = $("#token").val();
    var remember = $("input[type='checkbox']").is(':checked');
    var ph = $("#ph");
    var phw = $("#phw");
    if (phones == '' || phones == null) {
        ph.html("手机号码不能为空，请重填");
        return false;
    }
    if (!(/^1(3|4|5|7|8)\d{9}$/.test(phones))) {
        ph.html("请输入正确的手机号码，请重填");
        return false;
    }
    if (pwd.length < 6 || pwd.length > 16) {
        phw.html("请输入6-16位的登录密码");
        return false;
    }
    $.ajax({
        url: '/qt_logsub',
        type: "post",
        data: {phones: phones, pwd: pwd, token: token, remember: remember},
        dataType: "json",
        timeout: 30000,
        success: function (json) {
            if (json.code == 1) {//ok
                window.location.href = window.location.href;
            }
            if (json.code == 2) {//ok
                phw.html(json.mess);
            }
            if (json.code == 3) {//ok
                phw.html(json.mess);
            }
        }
    });

}


